package extrace.ui.main.ui;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

import extrace.ui.domain.ExpressEditActivity;
import extrace.ui.main.R;

public class InputActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_input);
        final EditText editText = findViewById(R.id.input);
        Button button = findViewById(R.id.search);
        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent();
                intent.putExtra("Action","Query");
                intent.putExtra("BarCode",editText.getText().toString());
                intent.setClass(getApplicationContext(), ExpressEditActivity.class);
                startActivityForResult(intent, 0);
                finish();
            }
        });
    }
}